From: Jonas Dreßler Date: Mon, 8 Jun 2020 12:50:23 +0000 (+0200) Subject: workspace: Close windows using new layout manager API X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~270 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=40123ae6da09d37d7afedf3eb1437308ced4559b;p=gnome-shell.git workspace: Close windows using new layout manager API Now that we have a new API to get all the windows and metaWindows from our layout manager, implement the deleteAll() method of the window clone using that API instead of looping through the children of the actor and using the source of the ClutterClone. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298 --- diff --git a/js/ui/workspace.js b/js/ui/workspace.js index c815ebec8..ef34860da 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -290,16 +290,15 @@ var WindowClone = GObject.registerClass({ } deleteAll() { + const windows = this.layout_manager.getWindows(); + // Delete all windows, starting from the bottom-most (most-modal) one - let windows = this.get_children(); - for (let i = windows.length - 1; i >= 1; i--) { - let realWindow = windows[i].source; - let metaWindow = realWindow.meta_window; + for (const window of windows.reverse()) { + const metaWindow = this.layout_manager.getMetaWindow(window); metaWindow.delete(global.get_current_time()); } - this.metaWindow.delete(global.get_current_time()); this._closeRequested = true; }